const http = require("http");
const ejs = require("ejs");
const app = require("./module/moduleExpress.js");

//通过http.createServer执行了app方法，触发执行了invokMethod的注册方法
http.createServer(app).listen(8080);

app._get("/", function (req, res) {
    res.send("哈喽！this is app._get() to home");
});

app._get("/login", function (req, res) {
    ejs.renderFile("./views/login.html", {}, function (err, data) {
        res.send(data);
    });
});

app._post("/dologin", function (req, res) {
    let queryParams = req.queryParams;
    res.send("哈喽！this is app._post() to dologin " + queryParams);
});